home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_irisdoor.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  143 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_IrisDoor.cog
  4. #
  5. # Door Script
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message     startup
  14.     message     activate
  15.     
  16.     thing       idolkey
  17.     thing       idolstand
  18.     
  19.     thing       camera0
  20.     thing       target0
  21.     thing       camera1
  22.     thing       target1
  23.  
  24.     thing        door0           linkid=0 mask=0x405
  25.     thing        door1           linkid=0 mask=0x405
  26.     thing        door2           linkid=0 mask=0x405
  27.     thing        door3            linkid=0 mask=0x405
  28.     thing        door4            linkid=0 mask=0x405
  29.     thing        door5            linkid=0 mask=0x405
  30.     thing        door6            linkid=0 mask=0x405
  31.     thing        door7            linkid=0 mask=0x405
  32.     
  33.     sector      doorsector      local
  34.     thing       player          local
  35.  
  36.     flex        moveSpeed=0.5
  37.     flex        waittime
  38.     
  39.     sound       slidesound=teo_spike_block_c.wav        local
  40.     sound       stopit=gen_stone_stop_c.wav             local
  41.     
  42.     sound       indyline0=inxj001.wav                   local
  43.     sound       indyline1=inxj005.wav                   local
  44.     sound       indyline2=inxj151.wav                   local
  45.     sound       indyline3=inxj150.wav                   local
  46.     sound       awesomewav=mus_teo_irissunlight.wav     local
  47.     
  48.     sound       indylineb0=inxj058.wav      local
  49.     sound       indylineb1=inxj059.wav      local
  50.     sound       indylineb2=inxj060.wav      local
  51.     sound       indylineb3=inxj061.wav      local
  52.     sound       indylineb4=inxj090.wav      local
  53.     sound       indylineb5=inxj095.wav      local
  54.         
  55.     int         itemnum
  56.     int            doorcount        local
  57.     int         bnosound0=0     local
  58.     int         bnosound1=0     local
  59.     int         soundchan0      local
  60.     int         linechannel     local
  61.     int         takecheck=0     local
  62.     int         wepnum=1        local
  63.     
  64. end
  65.  
  66. # ========================================================================================
  67.  
  68. code
  69.  
  70. # ........................................................................................
  71. startup:
  72.  
  73.     doorsector=GetThingSector(door0);
  74.     SectorAdjoins(doorsector, 0);
  75.     player = GetLocalPlayerThing();
  76.     
  77. return;
  78.  
  79. # ........................................................................................
  80. activate:
  81.  
  82.     if ((GetSenderRef() == idolkey) && (takecheck == 0) && (GetCurItem(player) == 0))
  83.     {
  84.         takecheck = 1;
  85.         StartCutScene(1);
  86.         SetActorFlags(player, 0x200000);
  87.         StopThing(player);
  88.         While(wepnum !=0)
  89.         {
  90.             wepnum = GetCurWeapon(player);
  91.             DeselectWeaponWait(player);
  92.         }
  93.         PlayMode(player, 61, 0);
  94.         SetExtCamOffsetToThing(camera0);
  95.         linechannel = PlayVoice(player, indyline0[(RandBetween(0,3))], 1, 0);
  96.         Sleep(0.35);
  97.         DestroyThing(idolkey);
  98.         MoveToFrame(idolstand, 1, 1);
  99.         ChangeInv(player, itemnum, 1);
  100.         SetInvAvailable(player, itemnum, 1);
  101.         JonesInvItemChanged(itemnum);
  102.         WaitForSound(linechannel);
  103.         Sleep(1);
  104.         SectorAdjoins(doorsector, 1);
  105.         SetCameraFocus(2, camera1);
  106.         SetCameraSecondaryFocus(2, target1);
  107.         SetCurrentCamera(2);
  108.         MoveToFrame(target1, 1, 2);
  109.         PlaySoundLocal(awesomewav, 1, 0, 0, 0);
  110.         WaitForStop(target1);
  111.         soundchan0 = PlaySoundThing(slidesound, door0, 1, 10, 20, 0x1);
  112.         for (doorcount=0; doorcount<=7; doorcount=doorcount+1)
  113.         {
  114.             MoveToFrame(door0[doorcount], 1, moveSpeed);
  115.         }
  116.         WaitForStop(door0);
  117.         StopSound(soundchan0, 0.5);
  118.         PlaySoundThing(stopit, door0, 1, 10, 20, 0x00);
  119.         Sleep(2);
  120.         SetCurrentCamera(1);
  121.         RestoreExtCam();
  122.         EndCutScene();
  123.         wepnum = 1;
  124.         ClearActorFlags(player, 0x200000);
  125.     }
  126.     
  127.     if ((GetCurItem(player) != 0) && (GetSenderRef() == idolkey))
  128.     {
  129.         StopThing(player);
  130.         StartCutscene(0);
  131.         SetActorFlags(player, 0x200000);
  132.         PlayVoice(player, indylineb0[(RandBetween(0, 5))], 1, 1);
  133.         EndCutscene();
  134.         ClearActorFlags(player, 0x200000);
  135.     }
  136.     
  137. return;
  138.     
  139. # ........................................................................................
  140.  
  141. end
  142.  
  143.